﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="persokanKPI edit.aspx.cs" Inherits="BSCMFF.Web.Pages.working.persokanKPI_edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


<telerik:RadComboBox ID="RadComboBoxEmployee" runat="server" Height="200px" Width="200px" ViewStateMode="Enabled"
        DropDownWidth="298px" EmptyMessage="Choose an Employee" 
        AllowCustomText="True" Filter="Contains"
                HighlightTemplatedItems="True" 
                DataTextField="Fullname" DataValueField="ID" 
                AutoPostBack="true" 
                        
        >
        <%--EnableLoadOnDemand="true" OnItemsRequested="RadComboBoxProduct_ItemsRequested">--%>
        <HeaderTemplate>
            <table style="width: 275px" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="width: 55px;">
                        <asp:Label ID="LabelPhoto" runat="server" Text="Photo" ></asp:Label>
                    </td>
                    <td style="width: 180px;">
                        <asp:Label ID="LabelEmployeeName" runat="server" Text="Fullname" ></asp:Label>
                    </td>
                    <td style="width: 60px;">
                        <asp:Label ID="LabelJobPosition" runat="server" Text="Job Position" ></asp:Label>
                    </td>
                    <%--<td >
                        <asp:Label ID="LabelDepartment" runat="server" Text="Department" ></asp:Label>
                    </td>--%>
                </tr>
            </table>
        </HeaderTemplate>
        <ItemTemplate>
            <table style="width: 300px" cellspacing="0" cellpadding="2">
                <tr>
                    <td style="width: 55px;">
                        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%# Eval("Photo") %>' ImageUrl="~/Images/silhouette/silhouette-stewie.jpg"
                        Width="50px" Height="50px" AutoAdjustImageControlSize="false" />
                    </td>
                    <td style="width: 180px;">
                        <%--<%# DataBinder.Eval(Container, "User.Login")%>--%>
                        <%# Eval("Fullname")%>
                    </td>
            
                    <td style="width: 60px;">
                        <%# Eval("Job_Position")%>
                    </td>
                    <%--<td style="width: 40px;">
                        <%# Eval("")%>
                    </td>--%>
                </tr>
            </table>
        </ItemTemplate>
        </telerik:RadComboBox>
    <asp:Panel ID="PanelEmployeePKPIs" runat="server" Visible="false">
    <telerik:RadGrid ID="RadGridPersonalKPIs" runat="server" 
    CellSpacing="0"  
    GridLines="None" AutoGenerateColumns="False" DataSourceID="EntityDataSourcePKPIs" >
        
    <MasterTableView DataKeyNames="Personal_KPI_ID" DataSourceID="EntityDataSourcePKPIs"
            >
        <Columns>
            <telerik:GridBoundColumn DataField="KPI.Name" 
                FilterControlAltText="Filter KPI.Name column" HeaderText="KPI" 
                ReadOnly="True" SortExpression="KPI.Name" UniqueName="KPI.Name">
            </telerik:GridBoundColumn>
            
            <telerik:GridBoundColumn DataField="Personal_KPI_ID" DataType="System.Int32"  Visible="false"
                FilterControlAltText="Filter Personal_KPI_ID column" 
                HeaderText="Personal_KPI_ID" ReadOnly="True" SortExpression="Personal_KPI_ID" 
                UniqueName="Personal_KPI_ID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Name" 
                FilterControlAltText="Filter Name column" HeaderText="Name" 
                SortExpression="Name" UniqueName="Name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" 
                FilterControlAltText="Filter Description column" HeaderText="Description" 
                SortExpression="Description" UniqueName="Description">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="User_FK" DataType="System.Int32"  Visible="false"
                FilterControlAltText="Filter User_FK column" HeaderText="User_FK" 
                SortExpression="User_FK" UniqueName="User_FK">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="KPI_FK" DataType="System.Int32"  Visible="false"
                FilterControlAltText="Filter KPI_FK column" HeaderText="KPI_FK" 
                SortExpression="KPI_FK" UniqueName="KPI_FK">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Measure" 
                FilterControlAltText="Filter Measure column" HeaderText="Measure" 
                SortExpression="Measure" UniqueName="Measure">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MeasureType" Visible="false"
                FilterControlAltText="Filter MeasureType column" HeaderText="MeasureType" 
                SortExpression="MeasureType" UniqueName="MeasureType">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CurrentValue" DataType="System.Int32" 
                FilterControlAltText="Filter CurrentValue column" HeaderText="CurrentValue" 
                SortExpression="CurrentValue" UniqueName="CurrentValue">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TargetValue" DataType="System.Int32" 
                FilterControlAltText="Filter TargetValue column" HeaderText="TargetValue" 
                SortExpression="TargetValue" UniqueName="TargetValue">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="StartValue" DataType="System.Int32" 
                FilterControlAltText="Filter StartValue column" HeaderText="StartValue" 
                SortExpression="StartValue" UniqueName="StartValue">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Percentage" 
                FilterControlAltText="Filter Percentage column" HeaderText="Percentage" 
                ReadOnly="True" SortExpression="Percentage" UniqueName="Percentage">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn Text="Edit" CommandName="Edit" >
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" >
            </telerik:GridButtonColumn>
        </Columns>
    
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>

    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>

    <EditFormSettings >
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
    </MasterTableView>

    <FilterMenu EnableImageSprites="False"></FilterMenu>

    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
        
</telerik:RadGrid>
</asp:Panel>
    <asp:EntityDataSource ID="EntityDataSourcePKPIs" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Personal_KPI" Include="KPI" 
        Where="it.User_FK = @user_FK">
        <WhereParameters>
            <asp:ControlParameter ControlID="RadComboBoxEmployee" DbType="Int32" 
                DefaultValue="0" Name="user_FK" PropertyName="SelectedValue" />
        </WhereParameters>
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceKPIs" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="KPIs" Select="it.[KPI_ID], it.[Name]">
    </asp:EntityDataSource>


</asp:Content>
